<%@ page language="java" contentType="text/html; charse=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<jsp:include page="../public/header.jsp"/> 
</head>
<body>
<jsp:include page="../public/nav.jsp"/>
	<div class="context">
    	 <script id="editor" type="text/plain" style="width:980px;height:500px;"></script>
    </div>
	<div class="context">
    	<div class="f-l"><label>标题:&nbsp;</label></div>
        <div class="f-l"><input id="title" class="input-text" type="text" placeholder="标题"></div>
        <div class="f-r"><input id="apply" class="btn btn-warning" value="发布"></div>
    </div>
    <div class="clearfix"></div>

<jsp:include page="../public/footer.jsp"/> 
</body>

<jsp:include page="../public/footer2.jsp"/>
<script type="text/javascript" charset="utf-8" src="/public/static/ueditor/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/static/ueditor/utf8-jsp/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/static/ueditor/utf8-jsp/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
var ue = UE.getEditor('editor');
$(function(){
	$("#apply").click(function(){
		var html = ue.getContent();
		//alert(html);
		var title = $("#title").val();
		$.ajax({url:"/users/article/apply.html",data:{title:title,context:html},type:"post",success:function(data){
			if(data != 0){
				window.location.href="/article/"+data+".html";
			}
		}});
	});
})

</script>
</html>
